package com.example.springioc.v2;

public class Main {

    public static void main(String[] args) {
        // 如果采用 ioc 思想 即对应的对象由调用者决定 那么就可以实现低耦合
        // 当需要扩展对应的业务的时候 只需要修改一处即可
        Tire tire = new Tire(14);
        Bottom bottom = new Bottom(tire);
        Framework framework = new Framework(bottom);
        Car car = new Car(framework);
        car.run();

        Tire tire2 = new Tire(1);
        Bottom bottom2 = new Bottom(tire);
        Framework framework2 = new Framework(bottom);
        Car car2 = new Car(framework);
        car2.run();
    }
}
